﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using PlugNT.Cms.Model;
using PlugNT.Cms.BLL;
using PlugNT.Cms.Page;

namespace PlugNT.Cms.Web.Admin.Pre_Enterprise
{
    public partial class Add : AdminPage
    {
        private Enterprise curEnterprise = new Enterprise();

        protected void Page_Load(object sender, EventArgs e)
        {
            //权限检测
            this.CheckPower();

            if (!IsPostBack)
            {

            }
        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {

            EnterpriseInfo model = new EnterpriseInfo();
            model.name = txtTargetUrl.Text.Trim();
            model.description = txtDescription.Text.Trim();
            model.info = txtContent.Text.Trim();


            if (curEnterprise.Add(model))
            {
                Response.Redirect("../Message.aspx?message=添加企业成功！&z=yes");
            }
            else
            {
                Response.Redirect("../Message.aspx?message=添加企业失败！&z=no");
            }
        }
    }
}
